<?php

namespace FileSystem\drivers;

/**
 * Class Local
 * @author hwz
 */
class Local extends Adapter
{

    /**
     * touch
     * @return void
     * @author hwz
     **/
    public function touch($file) {
        return touch($this->root . $file);
    }

    /**
     * mkdir
     * @return void
     * @author hwz
     **/
    public function mkdir($path,$mode=0777,$recursive=false) {
        return @mkdir($this->root . $path,$mode,$recursive);
    }

    /**
     * cd
     * @return void
     * @author hwz
     **/
    public function cd($path) {
        $this->root = rtrim($path,'/') . '/';
    }

    /**
     * chmod
     * @return void
     * @author hwz
     **/
    public function chmod($path,$pattern) {
        return @chmod($path,$pattern);
    }

    /**
     * rmdir
     * @return void
     * @author hwz
     **/
    public function rmdir($path) {
        return rmdir($path);
    }
}
